#ifndef __RECEIVERESULT_H__
#define __RECEIVERESULT_H__

#include "BaseThread.h"

#include <string>
#include <stdint.h>

class TestCase;

class ReceiveResult: public BaseThread
{
public:
    ReceiveResult(TestCase &oneCase, int listen, int timeout);
    ~ReceiveResult();

    virtual void DoProcess();

    void setSaveResultMode(bool saveResultMode);

private:
    bool CompareResult(const std::string &resExpected,
            const std::string &resCurrent);
    bool PreSocket();

    void ParseResult(std::string &results);

    void setFailedReason(const std::string &reason);

private:
    TestCase &oneCase_;
    int sock_;
    bool finished_;
    uint32_t cmpIdx_;
    bool saveResultMode_;
    int listen_;
    int timeout_;
};

#endif
